import { Component, OnInit } from '@angular/core';
import { LeanCloudService } from 'app/utils/lean-cloud.service'
@Component({
  selector: 'app-work-header',
  templateUrl: './work-header.component.html',
  styleUrls: ['./work-header.component.less']
})
export class WorkHeaderComponent implements OnInit {

  private currentUser
  constructor(
    private leanCloudService: LeanCloudService
  ) { }

  ngOnInit() {
    let user = this.leanCloudService.User.current()
    let query = this.leanCloudService.Query('user')
    query.equalTo('auth', user)
    query.first()
      .then((user:any) => {
        console.log(user)
        this.currentUser = user.toJSON()
      })
  }

}
